#pragma once

struct ID3D10Device;
struct ID3D10Effect;
struct ID3D10EffectTechnique;
class CDXUTTextHelper;

#include <DXUT.h>


namespace e3d
{
	class ILODSelector;

	struct TexturedVertex
	{
		D3DXVECTOR3 position;
		D3DXVECTOR3 normal;
		D3DXVECTOR2 textureCoordinates;
		//D3DXVECTOR4 color;
	};

	struct ColoredVertex
	{
		D3DXVECTOR3 position;
		D3DXVECTOR3 normal;
		D3DXVECTOR4 color;
	};

	struct ShadowMapVisualizationVertex
	{
		D3DXVECTOR3 position;
		D3DXVECTOR2 textureCoordinates;
	};

	struct VertexHM
	{
		D3DXVECTOR2 position;
		D3DXVECTOR2 textureCoordinates;
	};

	struct BoundingBox
	{
		D3DXVECTOR3 topLeftFront;
		D3DXVECTOR3 topRightFront;
		D3DXVECTOR3 bottomRightFront;
		D3DXVECTOR3 bottomLeftFront;
		D3DXVECTOR3 topLeftBack;
		D3DXVECTOR3 topRightBack;
		D3DXVECTOR3 bottomRightBack;
		D3DXVECTOR3 bottomLeftBack;

		D3DXVECTOR3 center() const
		{
			D3DXVECTOR3 width((  topRightFront - topLeftFront) / 2 );
			D3DXVECTOR3 height((  bottomLeftFront - topLeftFront) / 2 );
			D3DXVECTOR3 depth(( topLeftBack - topLeftFront  ) / 2 );
			return width + height + depth + topLeftFront;
		}
	};
}


namespace e3d
{
	class IRenderObject
	{
	public:
		IRenderObject(){};
		virtual ~IRenderObject(){};

		// getter
		virtual const D3DXVECTOR3& position() const = 0;
		virtual const D3DXVECTOR3& rotation() const = 0;
		virtual const D3DXVECTOR3& size() const = 0;
		virtual unsigned int LOD() const = 0;
		virtual unsigned int resolution() const = 0;

		// setter
		virtual void position( const D3DXVECTOR3& newPos ) = 0;
		virtual void rotation( const D3DXVECTOR3& newRot ) = 0;
		virtual void size( const D3DXVECTOR3& newSize ) = 0;

		virtual e3d::BoundingBox boundingBox() const = 0;

		virtual void render( ID3D10EffectTechnique* tech, const D3DXVECTOR3* camPos) = 0;
		virtual void renderBoundingBox( bool isEnabled ) = 0;
		
		virtual bool active() const = 0;
		virtual void active( bool status ) = 0;

		virtual bool isCastingShadows() = 0;
		
	};

}
